import { createApp } from 'vue'
import App from '@/App.vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
// elementplus配置国际化
import { zhCn } from 'element-plus/es/locales.mjs'
// 使用svg矢量图标需要导入的配置
import 'virtual:svg-icons-register'
import globalComponent from '@/components/index.ts'
// 引入清除默认样式的文件
import '@/styles/index.scss'
// 引入状态存储实例对象pinia
import pinia from './store'
import router from '@/router/index.ts'
// 挂载路由鉴权文件
import './permission.ts'

// Element Plus支持暗黑模式，只需要引入如下样式文件
import 'element-plus/theme-chalk/dark/css-vars.css'
// 引入自定义button指令
import { isHasButton } from '@/directive/hasBtn.ts'

const app = createApp(App)

app.use(ElementPlus, {
  locale: zhCn,
})
app.use(globalComponent)
app.use(router)
app.use(pinia)
isHasButton(app)
app.mount('#app')
